#define _GNU_SOURCE
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>


void *first_pthread(void *arg){
    printf("first进程开始执行%d\n",gettid());
    return NULL;
}

void *second_pthread(void *arg){
    printf("second进程开始执行%d\n",gettid());
    return NULL;
}

int main(int argc, char const *argv[])
{
    printf("主进程开始%d\n",gettid());
    pthread_t pt1,pt2;
    pthread_create(&pt1,NULL,first_pthread,NULL);
    pthread_create(&pt2,NULL,second_pthread,NULL);

    pthread_join(pt1,NULL);
    pthread_join(pt2,NULL);

    printf("主进程结束%d\n",gettid());


    return 0;
}
